// 智能数据交换云平台地址
// import {dataExchangeHost} from '@/views/api/api'     //生产环境地址
export const dataExchangeHost = 'http://192.168.1.183:9587';     //干英地址，测试时用

//引用axios所需要组件
import axios from 'axios'

//封装axios
export const axiosDataFun = (method,url,dataParam) => {
    return axios({
        headers: {
            'Content-Type': 'application/json'
        },
        method: method,
        url: url,
        data: dataParam
    }).then(res => res).catch( error => error )
}

//组织信息列表添加
export const organizationDataExchangeAdd = (param) => {
    return axiosDataFun('post', dataExchangeHost+'/organization/save', param).then(res => res);
}

//组织信息列表删除
export const organizationDataExchangeDel = (param,id) => {
    return axiosDataFun('get', dataExchangeHost+'/organization/'+id+'/del', param).then(res => res);
}

//组织信息列表和查询
export const organizationDataExchangeListSearch = (param) => {
    return axiosDataFun('post', dataExchangeHost+'/organization/search', param).then(res => res);
}

//组织信息列表详细内容
export const organizationDataExchangeListDetail = (param,id) => {
    return axiosDataFun('get', dataExchangeHost+'/organization/detail/'+id, param).then(res => res);
}

//组织信息列表更新
export const organizationDataExchangeUpdata = (param) => {
    return axiosDataFun('post', dataExchangeHost+'/organization/update', param).then(res => res);
}
